/** file AudioFactory.cpp
    author belot.nicolas
*/

#include "AudioFactory.h"

#ifdef HAVE_LIBARTS
#include "AudioArts.h"
#endif

#ifdef HAVE_LIBALSA
#include "AudioAlsa.h"
#endif

#ifdef HAVE_LIBJACK
#include "AudioJack.h"
#endif

#include "AudioWAV.h"

namespace libtrckr {
Audio* AudioFactory::getNewAudio(const std::string& type){
	Audio *ret;
	#ifdef HAVE_LIBJACK
	if(type=="Jack"){
		ret = new AudioJack();
	}else
	#endif
	#ifdef HAVE_LIBALSA
	 if(type=="Alsa"){
		ret = new AudioAlsa();
	}else
	#endif
	#ifdef HAVE_LIBARTS
	 if(type=="Arts"){
		ret = new AudioArts();
	}else
	#endif
	 if(type=="Wav"){
		ret = new AudioWAV();
	}else{
		ret = NULL;
		std::cerr << "Unknown audio : " <<  type << std::endl;
	}
	return ret;
}

}
